/**
 * 
 */
import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @author haimonti
 *
 */
public class GetInfo extends HttpServlet 
{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	public void doGet(HttpServletRequest request,HttpServletResponse response) throws IOException, ServletException
	{
		response.setContentType("text/html");

		PrintWriter out = response.getWriter();
		out.println("<html>");
		out.println("<body>");
		out.println("<head>");

		out.println("<title>Submit Polygon or Path to GIS</title>");
		out.println("</head>");
		out.println("<body bgcolor=\"white\">");

		out.println("<P>");
		out.print("<form action=\"");
		out.print("DownloadKMLInfo\" ");
		out.println("method=POST>");
		out.println("Paste Polygon or Path from Google Earth here");
		out.println("<br>");
		out.println("<textarea cols=\"100\" rows=\"30\" name=getkml>");
		out.println("</textarea>");
		out.println("<br>");
		out.println("<br>");
		out.println("<table>");
		out.println("<tr>");
		out.println("<th>");
		out.println("Select the Trouble Types");
		out.println("</th>");
		out.println("<th>");
		out.println("");
		out.println("</th>");
		out.println("<th>");
		out.println("Select the Borough");
		out.println("</th>");
		out.println("</tr>");
		out.println("<tr>");
		out.println("<td>");
		out.println("<select name=tt style=\"Width:200\" Width=\"200\" size=2 multiple>"); 
		out.println("<option value=\"MHF\">MHF</option>"); 
		out.println("<option value=\"MHO\">MHO</option>");
		out.println("<option value=\"MHX\">MHX</option>");
		out.println("<option value=\"SMH\">SMH</option>");
		out.println("<option value=\"ENE\">ENE</option>");
		out.println("<option value=\"ESR\">ESR</option>");
		out.println("<option value=\"FLT\">FLT</option>"); 
		out.println("<option value=\"LV\">LV</option>");
		out.println("<option value=\"WBR\">WBR</option>");
		out.println("<option value=\"SO\">SO</option>");
		out.println("<option value=\"UAC\">UAC</option>");
		out.println("<option value=\"ACB\">ACB</option>");
		out.println("<option value=\"SOP\">SOP</option>"); 
		out.println("<option value=\"SOB\">SOB</option>");
		out.println("<option value=\"NL\">NL</option>");
		out.println("<option value=\"NLA\">NLA</option>");
		out.println("<option value=\"UDC\">UDC</option>");
		out.println("<option value=\"DCB\">DCB</option>");
		out.println("<option value=\"FRQ\">FRQ</option>");
		out.println("</select>");

		out.println("</td>");
		out.println("<td></td>");
		out.println("<td>");
		out.println("<select name=borough style=\"Width:200\" Width=\"200\" size=2 multiple>"); 
		out.println("<option value=\"ME\">Manhattan</option>"); 
		out.println("<option value=\"BE\">Brooklyn</option>");
		out.println("</select>");

		out.println("</td>");
		out.println("</tr>");

		out.println("</table>");



		out.println("<br>");
		out.println("<br>");
		out.println("<input type=submit value=\"Send to GIS\"><button type=reset value=\"Clear the form\">");
		out.println("</form>");

		out.println("</body>");
		out.println("</html>");
	}

	public void doPost(HttpServletRequest request,HttpServletResponse response) throws IOException, ServletException
	{
		doGet(request, response);
	}

}

